package com.zandequan.modules.article.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.zandequan.modules.article.dao.MediaDao;
import com.zandequan.modules.article.entity.MediaEntity;
import com.zandequan.modules.article.service.MediaService;



@Service("mediaService")
public class MediaServiceImpl implements MediaService {
	@Autowired
	private MediaDao mediaDao;
	
	@Override
	public MediaEntity queryObject(Integer articleMediaId){
		return mediaDao.queryObject(articleMediaId);
	}
	
	@Override
	public List<MediaEntity> queryList(Map<String, Object> map){
		return mediaDao.queryList(map);
	}
	
	@Override
	public int queryTotal(Map<String, Object> map){
		return mediaDao.queryTotal(map);
	}
	
	@Override
	public void save(MediaEntity media){
		media.setCreateTime(new Date());
		media.setUpdateTime(new Date());
		mediaDao.save(media);
	}
	
	@Override
	public void update(MediaEntity media){
		mediaDao.update(media);
	}
	
	@Override
	public void delete(Integer articleMediaId){
		mediaDao.delete(articleMediaId);
	}
	
	@Override
	public void deleteBatch(Integer[] articleMediaIds){
		mediaDao.deleteBatch(articleMediaIds);
	}
	
}
